using System;
using System.Collections.Generic;
using System.Text;

namespace Kdg.Tools.FilesCopier
{
    public partial class FilesCopierProcessor
    {
        public class CopyReportEventArgs
        {
            private string _source;
            private string _dest;
            private long _bytesCopied;
            private long _length;
            private string _fileName;
            private double _speed;
            private Exception _exception = null;
            private string _message = string.Empty;

            public CopyReportEventArgs(string FileName, string Source, string Dest, long Length, long ByteCopied)
            {
                _fileName = FileName;
                _source = Source;
                _dest = Dest;
                _length = Length;
                _bytesCopied = ByteCopied;
            }
            public CopyReportEventArgs(string FileName, string Source, string Message)
            {
                _fileName = FileName;
                _source = Source;
                _message = Message;
            }
            public double Speed
            {
                get { return _speed; }
                set { _speed = value; }
            }
            public string FileName
            {
                get { return _fileName; }
                set { _fileName = value; }
            }
            public long Length
            {
                get { return _length; }
                set { _length = value; }
            }
            public string SourceFolder
            {
                get { return _source; }
                set { _source = value; }
            }
            public string DestinationFolder
            {
                get { return _dest; }
                set { _dest = value; }
            }
            public long BytesCopied
            {
                get { return _bytesCopied; }
                set { _bytesCopied = value; }
            }
            public int ProgressPercentage
            {
                get
                {
                    double sourceLength = (double)_length;
                    double byteCopied = (double)_bytesCopied;
                    int percentage = 0;
                    if (sourceLength != 0)
                        percentage = (int)(byteCopied / sourceLength * 100.0);

                    return percentage;
                }
            }
            public Exception Exception
            {
                get { return _exception; }
                set { _exception = value; }
            }
            public string Message
            {
                get { return _message; }
                set { _message = value; }
            }


        }
    }
}
